<template>
  <div class="left-container">
    <h3>Left 组件 ---{{ name }}----{{ count }}</h3>
    <button @click="add">+1</button>
  </div>
</template>

<script>
import bus from '../eventBus'
export default {
  data(){
    return{
      age:1
    }
  },
  props:{
    name:{
      type:String
    },
    count:{
      type:Number
    }
  },
  methods: {
    add(){
      this.age++
      this.$emit('changeCount',this.age)
      bus.$emit('shart',this.age)
    }
  },

}
</script>

<style lang="less">
.left-container {
  padding: 0 20px 20px;
  background-color: orange;
  min-height: 250px;
  flex: 1;
}
</style>
